Skip to content

feat(orchestrator): compose per-queue speculators and turn speculation on - #508

Open
behinddwalls wants to merge 1 commit into
preetam/speculation-finalizationfrom
preetam/speculation-wiring
Open

feat(orchestrator): compose per-queue speculators and turn speculation on#508
behinddwalls wants to merge 1 commit into
preetam/speculation-finalizationfrom
preetam/speculation-wiring

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why?

Everything below this commit landed inert: the orchestrator passed the speculate run a placeholder that proposes nothing, so no path was ever funded and no speculative build started. The machinery is all reviewed; nothing configures it per queue or switches it on.

What?

This is the activation switch. Per-queue profiles gain a Scorer and a Speculator: each queue's speculator is composed from its own scorer as standard.New(bestfirst.New(scorer), sticky.New(budget)), with a factory adapter beside the existing ones so routing stays in the wiring layer, and main.go swaps the placeholder for profiles.SpeculatorFactory().

The scorer profiles are the policy knobs: the baseline scores everything 0.5, test-queue buckets by lines changed, and e2e-test-queue exercises the composite scorer. Every scorer is wrapped by scorerfake so a change URI carrying a failure marker forces a scoring error end-to-end. The build budget is a wiring-level constant (4 concurrent builds per queue) with a TODO to move it onto entity.QueueConfig.

With this commit, paths are funded, builds run per path, and batches finalize from their paths — the whole stack goes live in one revertable step.

Test Plan

bazel build //..., make fmt, make gazelle

make e2e-test — the full pipeline lands changes end-to-end with per-path speculation on.

Issues

@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 628e4f8 to 74850fd Compare August 4, 2026 04:46
@behinddwalls
behinddwalls marked this pull request as ready for review August 4, 2026 04:47
@behinddwalls
behinddwalls requested review from a team and sbalabanov as code owners August 4, 2026 04:47
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 74850fd to b3d4549 Compare August 4, 2026 05:11
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from b3d4549 to 2eaab0e Compare August 5, 2026 03:15
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 2eaab0e to 563a58d Compare August 5, 2026 03:26
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 563a58d to 98c0912 Compare August 5, 2026 03:38
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 98c0912 to bc71c77 Compare August 5, 2026 03:44
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch 2 times, most recently from e8fdda1 to 00a94c1 Compare August 5, 2026 04:57
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 00a94c1 to 8aba69e Compare August 5, 2026 17:05
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch 2 times, most recently from 6f58c6a to db51df4 Compare August 5, 2026 19:05
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from db51df4 to 379d009 Compare August 6, 2026 02:16
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch 2 times, most recently from def40f8 to 949eb54 Compare August 6, 2026 03:04
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from 949eb54 to bf0b99c Compare August 6, 2026 03:17
…n on

## Summary

### Why?

Everything below this commit landed inert: the orchestrator passed the speculate run a placeholder that proposes nothing, so no path was ever funded and no speculative build started. The machinery is all reviewed; nothing configures it per queue or switches it on.

### What?

This is the activation switch. Per-queue profiles gain a `Scorer` and a `Speculator`: each queue's speculator is composed from its own scorer as `standard.New(bestfirst.New(scorer), sticky.New(budget))`, with a factory adapter beside the existing ones so routing stays in the wiring layer, and `main.go` swaps the placeholder for `profiles.SpeculatorFactory()`.

The scorer profiles are the policy knobs: the baseline scores everything 0.5, test-queue buckets by lines changed, and e2e-test-queue exercises the composite scorer. Every scorer is wrapped by `scorerfake` so a change URI carrying a failure marker forces a scoring error end-to-end. The build budget is a wiring-level constant (4 concurrent builds per queue) with a TODO to move it onto `entity.QueueConfig`.

With this commit, paths are funded, builds run per path, and batches finalize from their paths — the whole stack goes live in one revertable step.

## Test Plan

✅ `bazel build //...`, `make fmt`, `make gazelle`

✅ `make e2e-test` — the full pipeline lands changes end-to-end with per-path speculation on.
@behinddwalls
behinddwalls force-pushed the preetam/speculation-wiring branch from bf0b99c to 286ddbc Compare August 6, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant